| Conditions | 3 |
| Paths | 6 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | /* globals versionCompare, atob, btoa */ |
||
| 21 | this.load = function () { |
||
| 22 | try { |
||
| 23 | let storedPlayer = localStorage.getItem('player'); |
||
| 24 | if (!storedPlayer) { |
||
| 25 | this.initSave(); |
||
| 26 | } else { |
||
| 27 | state.player = JSON.parse(storedPlayer); |
||
| 28 | this.versionControl(); |
||
| 29 | } |
||
| 30 | } catch (err) { |
||
| 31 | alert('Error loading savegame, reset forced.'); |
||
| 32 | this.initSave(); |
||
| 33 | } |
||
| 34 | }; |
||
| 35 | |||
| 51 |